Despite advances in neuromodulation technology, therapeutic devices are often ineffective or have adverse side effects. Next-generation closed-loop neuromodulation systems will provide great potentials for improving the therapeutic outcome by sensing the neural states and adapting the neuromodulatory actions. These systems will provide powerful tools for understanding the mechanisms of treatment by elucidating the causal link between regulating the physiological states and the therapeutic or the behavioral outcomes. However, a lack of systematic approach to optimally control neurostimulation is a major barrier to fully utilize their potentials. Furthermore, the real-time implementation of advanced optimization and control algorithms requires powerful computing hardware that pose a major challenge for translating the effective neural interface systems into implantable or wearable devices with limited power supply. The proposed project is addressing these two problems by developing an open-source end-to-end platform, called NeuroWeaver, to design, test and deploy intelligent Closed-Loop Neuromodulation (iCLON) systems that automatically can learn the optimal neuromodulation control policies by interacting with the nervous system. We cast the problem of optimizing neuromodulation into reward-based learning where achieving the desired neural state or the therapeutic outcome represents a measure of reward for the iCLON system. We will use techniques from reinforcement learning and model predictive control to develop algorithms that enable iCLON systems learn the optimal actions to maximize their reward. Memory dysfunction is one of the most devastating symptoms of Alzheimer?s disease and age-related dementia. We will develop the NeuroWeaver platform in the context of designing iCLON systems to induce good memory states in the hippocampus by closed-loop amygdala stimulation. Optimizing the memory- enhancing effects of amygdala stimulation will have immediate benefits to research on treatments for memory disorders. More broadly, the NeuroWeaver platform can be combined with a wide range of biological sensors and actuators to design intelligent closed-loop control systems for regulating physiological processes far beyond the proposed application in this proposal. Our proposed platform will have the potential to create an open-source ecosystem for collaboration between machine learning, neuroscience, and computer architecture communities as well as provide tools for further enrichment of the algorithms and broader utilization in the biomedical domain.